package ningbo.Controlling_Execution;

import sun.applet.Main;

import java.util.Random;
import java.util.stream.IntStream;

/**
 * @Author 宁铂
 * @Date 2021/7/12 21:20
 * @Version 1.0
 */
public class BreakAndContinue {
    /** 本类测试 break 和 continue 在 for 和 while 循环中的例子 */
    public static void main(String[] args) {

        Random random = new Random();

        for(int i = 0; i < 100; i++) {
            if(i == 74) break; // Out of for loop
            if(i % 9 != 0) continue; // Next iteration
            System.out.print(i + " ");
        }
        System.out.println();
        int i = 0;
        // An "infinite loop":
        while(true) {
            i++;
            int j = i * 27;
            if(j == 1269) break; // Out of loop
            if(i % 10 != 0) continue; // Top of loop
            System.out.print(i + " ");
        }
    }
}

